import 'package:cached_network_image/cached_network_image.dart';
import 'package:chat_shop/common/appbar/appbar.dart';
import 'package:flutter/material.dart';
import 'package:chat_shop/common/const/cosnt.dart';
import 'package:chat_shop/page/mine/page/view/mine_cell.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';

class MinePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: CustomAppbar.normal(title: "我的", leading: const SizedBox(), action: [
          IconButton(
            onPressed: () {
              EasyLoading.showToast("设置");
            },
            icon: Icon(
              Icons.settings,
              size: 16,
            ),
          )
        ]),
        body: SafeArea(
          child: SingleChildScrollView(
            child: Column(
              children: [
                Container(
                  height: 220,
                  padding: const EdgeInsets.only(top: 20),
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.center,
                    children: [
                      PhysicalModel(
                        color: Colors.transparent,
                        clipBehavior: Clip.antiAlias,
                        shape: BoxShape.circle,
                        child: CachedNetworkImage(
                          imageUrl: 'https://picsum.photos/200/300',
                          width: 80,
                          height: 80,
                          fit: BoxFit.cover,
                          placeholder: (_, __) => Container(
                            color: Colors.grey,
                          ),
                        ),
                      ),
                      const SizedBox(
                        height: 12,
                      ),
                      Text(
                        "我的",
                        style: AppFont.textStyle(18, color: Colors.black),
                      ),
                      const SizedBox(height: 4),
                      Text(
                        "我就是我,不一样的烟火",
                        style: TextStyle(color: Colors.black),
                      )
                    ],
                  ),
                ),
                CustomCellView(
                  titles: [
                    "钱包",
                    "我的订单",
                    "我的最爱",
                    "我的客服",
                    "我的店铺",
                    "反馈意见",
                  ],
                  imgs: [
                    Icons.wallet,
                    Icons.list_alt,
                    Icons.favorite,
                    Icons.store,
                    Icons.support_agent_rounded,
                    Icons.feedback_rounded,
                  ],
                ),
                InkWell(
                  onTap: () => Navigator.pushNamedAndRemoveUntil(context, '/login', (route) => false),
                  child: Container(
                    width: double.infinity,
                    height: 36,
                    margin: const EdgeInsets.only(top: 100, left: 16, right: 16),
                    alignment: Alignment.center,
                    decoration: BoxDecoration(
                      borderRadius: BorderRadius.circular(30),
                      border: Border.all(color: AppColor.mainColor, width: 1),
                      color: AppColor.mainColor,
                    ),
                    child: Text(
                      "退出登录",
                      style: AppFont.textStyle(14, color: Colors.white),
                    ),
                  ),
                )
              ],
            ),
          ),
        ));
  }
}
